package com.iceflame.zxingane;

import java.util.HashMap;
import java.util.Map;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.iceflame.zxingane.funs.Decode;
import com.iceflame.zxingane.funs.Encode;
import com.iceflame.zxingane.funs.GetCameraMode;
import com.iceflame.zxingane.funs.OpenZXing;
import com.iceflame.zxingane.funs.SycDecode;

public class ZXingContext extends FREContext {
	
	
	private Map<String, FREFunction> funMap = null;

	@Override
	public void dispose() {
		
	}

	@Override
	public Map<String, FREFunction> getFunctions() {
		if(funMap == null){
			funMap = new HashMap<String, FREFunction>();
			funMap.put("encode", new Encode());
			funMap.put("decode", new Decode());
			funMap.put("sycdecode", new SycDecode());
			funMap.put("openzxing", new OpenZXing());
			funMap.put("getcameramode", new GetCameraMode());
		}
		return funMap;
	}

}
